/*
 * Utils.h
 *
 *  Created on: 21/01/2014
 *      Author: root
 */

#ifndef UTILS_H_
#define UTILS_H_

#include "Tuple.h"
#include "DppmSpec.h"
#include "Config.h"

//Initialization routines
int readDppmSpec(char* filePath, int &numAct, int &T, int* &numPreds, int** &Preds, int* &numModes, int** &ModesCosts, int** &ModesTimes);
//TODO - revisar
int defineIndexesParams(DppmSpec * dppm, int &indLen, int * &indBases);

//Auxiliary functions
Tuple * makeTupleFromModes(DppmSpec * dppm, int * tupleModes);
//TODO - revisar
int modesToIndex(int * modes, int indLen, int * indBases);
//TODO - revisar
int * indexToModes(int index, int indLen, int * indBases, DppmSpec * dppm, int fillOutOption);
int evalSolution(Tuple * candidate, Tuple * &bestSolution);
int evalSolution(int * candidate, Tuple * &bestSolution);

//Debug functions
void debugPrinter(int identacion, int rank, const char * archivo, int linea, const char * desc);
void debugPrinter(int identacion, int rank, const char * archivo, int linea, const char * desc, const char * var1Name, double var1);
void debugPrinter(int identacion, int rank, const char * archivo, int linea, const char * desc, const char * var1Name, double var1, const char * var2Name, double var2);
void debugPrinter(int identacion, int rank, const char * archivo, int linea, const char * desc, const char * var1Name, double var1, const char * var2Name, double var2, const char * var3Name, double var3);
void debugPrinter(int identacion, int rank, const char * archivo, int linea, const char * desc, const char * var1Name, int var1, const char * var2Name, int var2, const char * var3Name, int var3, const char * var4Name, int var4);

#endif /* UTILS_H_ */
